package com.itheima.case1;

public class case2Thread extends Thread{

    static int liping = 100;
    @Override
    public void run() {
        while(true){
            synchronized(case2Thread.class){
                if(liping < 10){
                    break;
                }else{
                    System.out.println(getName()+"@"+(100-(--liping))+";剩余礼品："+(liping));

                }
            }
        }
    }
}
